import { useState } from 'react';
import { useLocation } from 'react-router-dom'

export default () => {
  const location = useLocation();

  const [searchInfo, setSearchInfo] = useState({ keyword: location.state?.kw || '' });

  return <div>
    <h2>活动列表</h2>
    <div>
      <span>活动名称: </span>
      <input
        type="text"
        value={searchInfo.keyword}
        onChange={(e) => setSearchInfo({...searchInfo, keyword: e.target.value})}
      />
    </div>
    <div>携带的状态参数kw: { location.state?.kw || '-' }</div>
  </div>
}